import sys
from PyQt5.QtWidgets import QApplication, QWidget, QMainWindow
from MW import Ui_Dialog
from logic_MW1 import mwindow1
from logic_MW2 import mwindow2
from logic_MW3 import mwindow3


class mwindow(QWidget, Ui_Dialog):
    def __init__(self):
        super(mwindow, self).__init__()
        self.setupUi(self)
        self.connecter()

    def pb(self):
        # 跳转到子页面1
        # w.hide()   #如果有这一句，关闭子界面后就会关闭程序,没有这一句及是跳转时保留主窗口
        self.ui_1 = mwindow1()
        self.ui_1.show()

    def pb_2(self):
        # 跳转到子页面2
        self.ui_2 = mwindow2()
        self.ui_2.show()

    def pb_3(self):
        # 跳转到子页面3
        self.ui_3 = mwindow3()
        self.ui_3.show()

    def connecter(self):
        self.pushButton.clicked.connect(self.pb)
        self.pushButton_2.clicked.connect(self.pb_2)
        self.pushButton_3.clicked.connect(self.pb_3)
        self.pushButton_4.clicked.connect(self.close)


if __name__ == '__main__':
    app = QApplication(sys.argv)
    w = mwindow()
    w.show()
    sys.exit(app.exec_())